import 'package:flutter_deer/generated/json/base/json_convert_content.dart';
import 'package:flutter_deer/index/models/user_betting_entity.dart';

UserBettingResultEntity $UserBettingResultEntityFromJson(Map<String, dynamic> json) {
  final UserBettingResultEntity userBettingResultEntity = UserBettingResultEntity();
  final double? ratio = jsonConvert.convert<double>(json['ratio']);
  if (ratio != null) {
    userBettingResultEntity.ratio = ratio;
  }
  final String? playWay = jsonConvert.convert<String>(json['playWay']);
  if (playWay != null) {
    userBettingResultEntity.playWay = playWay;
  }
  final String? bettingTime = jsonConvert.convert<String>(json['bettingTime']);
  if (bettingTime != null) {
    userBettingResultEntity.bettingTime = bettingTime;
  }
  final double? bettingScore = jsonConvert.convert<double>(json['bettingScore']);
  if (bettingScore != null) {
    userBettingResultEntity.bettingScore = bettingScore;
  }
  final String? isGroup = jsonConvert.convert<String>(json['isGroup']);
  if (isGroup != null) {
    userBettingResultEntity.isGroup = isGroup;
  }
  final String? useScoreType = jsonConvert.convert<String>(json['useScoreType']);
  if (useScoreType != null) {
    userBettingResultEntity.useScoreType = useScoreType;
  }
  final String? bettingStatus = jsonConvert.convert<String>(json['bettingStatus']);
  if (bettingStatus != null) {
    userBettingResultEntity.bettingStatus = bettingStatus;
  }
  final String? status = jsonConvert.convert<String>(json['status']);
  if (status != null) {
    userBettingResultEntity.status = status;
  }
  final double? winScore = jsonConvert.convert<double>(json['winScore']);
  if (winScore != null) {
    userBettingResultEntity.winScore = winScore;
  }
  final double? willPrizeAmount = jsonConvert.convert<double>(json['willPrizeAmount']);
  if (willPrizeAmount != null) {
    userBettingResultEntity.willPrizeAmount = willPrizeAmount;
  }
  final List<UserBettingDetailEntity>? details = jsonConvert.convert<List<UserBettingDetailEntity>>(json['details']);
  if (details != null) {
    userBettingResultEntity.details = details;
  }
  final String? bettingType = jsonConvert.convert<String>(json['bettingType']);
  if (bettingType != null) {
    userBettingResultEntity.bettingType = bettingType;
  }
  return userBettingResultEntity;
}

Map<String, dynamic> $UserBettingResultEntityToJson(UserBettingResultEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['ratio'] = entity.ratio;
  data['playWay'] = entity.playWay;
  data['bettingTime'] = entity.bettingTime;
  data['bettingScore'] = entity.bettingScore;
  data['isGroup'] = entity.isGroup;
  data['useScoreType'] = entity.useScoreType;
  data['bettingStatus'] = entity.bettingStatus;
  data['status'] = entity.status;
  data['winScore'] = entity.winScore;
  data['willPrizeAmount'] = entity.willPrizeAmount;
  data['details'] = entity.details;
  data['bettingType'] = entity.bettingType;
  return data;
}

UserBettingDetailEntity $UserBettingDetailEntityFromJson(Map<String, dynamic> json) {
  final UserBettingDetailEntity userBettingDetailEntity = UserBettingDetailEntity();
  final String? teamOne = jsonConvert.convert<String>(json['teamOne']);
  if (teamOne != null) {
    userBettingDetailEntity.teamOne = teamOne;
  }
  final String? teamTwo = jsonConvert.convert<String>(json['teamTwo']);
  if (teamTwo != null) {
    userBettingDetailEntity.teamTwo = teamTwo;
  }
  final String? teamOneCover = jsonConvert.convert<String>(json['teamOneCover']);
  if (teamOneCover != null) {
    userBettingDetailEntity.teamOneCover = teamOneCover;
  }
  final String? teamTwoCover = jsonConvert.convert<String>(json['teamTwoCover']);
  if (teamTwoCover != null) {
    userBettingDetailEntity.teamTwoCover = teamTwoCover;
  }
  final String? playDate = jsonConvert.convert<String>(json['playDate']);
  if (playDate != null) {
    userBettingDetailEntity.playDate = playDate;
  }
  final String? playTime = jsonConvert.convert<String>(json['playTime']);
  if (playTime != null) {
    userBettingDetailEntity.playTime = playTime;
  }
  final String? gameTitle = jsonConvert.convert<String>(json['gameTitle']);
  if (gameTitle != null) {
    userBettingDetailEntity.gameTitle = gameTitle;
  }
  final double? odds = jsonConvert.convert<double>(json['odds']);
  if (odds != null) {
    userBettingDetailEntity.odds = odds;
  }
  final String? outcome = jsonConvert.convert<String>(json['outcome']);
  if (outcome != null) {
    userBettingDetailEntity.outcome = outcome;
  }
  final String? score = jsonConvert.convert<String>(json['score']);
  if (score != null) {
    userBettingDetailEntity.score = score;
  }
  final String? competitionResult = jsonConvert.convert<String>(json['competitionResult']);
  if (competitionResult != null) {
    userBettingDetailEntity.competitionResult = competitionResult;
  }
  final int? teamOneScoreResult = jsonConvert.convert<int>(json['teamOneScoreResult']);
  if (teamOneScoreResult != null) {
    userBettingDetailEntity.teamOneScoreResult = teamOneScoreResult;
  }
  final int? teamTwoScoreResult = jsonConvert.convert<int>(json['teamTwoScoreResult']);
  if (teamTwoScoreResult != null) {
    userBettingDetailEntity.teamTwoScoreResult = teamTwoScoreResult;
  }
  final int? letBallNum = jsonConvert.convert<int>(json['letBallNum']);
  if (letBallNum != null) {
    userBettingDetailEntity.letBallNum = letBallNum;
  }
  final double? minBallNum = jsonConvert.convert<double>(json['minBallNum']);
  if (minBallNum != null) {
    userBettingDetailEntity.minBallNum = minBallNum;
  }
  final double? maxBallNum = jsonConvert.convert<double>(json['maxBallNum']);
  if (maxBallNum != null) {
    userBettingDetailEntity.maxBallNum = maxBallNum;
  }
  return userBettingDetailEntity;
}

Map<String, dynamic> $UserBettingDetailEntityToJson(UserBettingDetailEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['teamOne'] = entity.teamOne;
  data['teamTwo'] = entity.teamTwo;
  data['teamOneCover'] = entity.teamOneCover;
  data['teamTwoCover'] = entity.teamTwoCover;
  data['playDate'] = entity.playDate;
  data['playTime'] = entity.playTime;
  data['gameTitle'] = entity.gameTitle;
  data['odds'] = entity.odds;
  data['outcome'] = entity.outcome;
  data['score'] = entity.score;
  data['letBallNum'] = entity.letBallNum;
  data['competitionResult'] = entity.competitionResult;
  data['teamOneScoreResult'] = entity.teamOneScoreResult;
  data['teamTwoScoreResult'] = entity.teamTwoScoreResult;
  data['minBallNum'] = entity.minBallNum;
  data['maxBallNum'] = entity.maxBallNum;
  return data;
}

UserBettingSearchEntity $UserBettingSearchEntityFromJson(Map<String, dynamic> json) {
  final UserBettingSearchEntity userBettingSearchEntity = UserBettingSearchEntity();
  final List<UserBettingEntity>? waitList = jsonConvert.convert<List<UserBettingEntity>>(json['waitList']);
  if (waitList != null) {
    userBettingSearchEntity.waitList = waitList;
  }
  final List<UserBettingEntity>? winList = jsonConvert.convert<List<UserBettingEntity>>(json['winList']);
  if (winList != null) {
    userBettingSearchEntity.winList = winList;
  }
  final List<UserBettingEntity>? lossList = jsonConvert.convert<List<UserBettingEntity>>(json['lossList']);
  if (lossList != null) {
    userBettingSearchEntity.lossList = lossList;
  }
  return userBettingSearchEntity;
}

Map<String, dynamic> $UserBettingSearchEntityToJson(UserBettingSearchEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['waitList'] = entity.waitList;
  data['winList'] = entity.winList;
  data['lossList'] = entity.lossList;
  return data;
}

UserBettingEntity $UserBettingEntityFromJson(Map<String, dynamic> json) {
  final UserBettingEntity userBettingEntity = UserBettingEntity();
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    userBettingEntity.id = id;
  }
  final String? name = jsonConvert.convert<String>(json['name']);
  if (name != null) {
    userBettingEntity.name = name;
  }
  final String? playWay = jsonConvert.convert<String>(json['playWay']);
  if (playWay != null) {
    userBettingEntity.playWay = playWay;
  }
  final String? bettingType = jsonConvert.convert<String>(json['bettingType']);
  if (bettingType != null) {
    userBettingEntity.bettingType = bettingType;
  }
  final String? isGroup = jsonConvert.convert<String>(json['isGroup']);
  if (isGroup != null) {
    userBettingEntity.isGroup = isGroup;
  }
  final String? ratioId = jsonConvert.convert<String>(json['ratioId']);
  if (ratioId != null) {
    userBettingEntity.ratioId = ratioId;
  }
  final String? groupId = jsonConvert.convert<String>(json['groupId']);
  if (groupId != null) {
    userBettingEntity.groupId = groupId;
  }
  final String? useScoreType = jsonConvert.convert<String>(json['useScoreType']);
  if (useScoreType != null) {
    userBettingEntity.useScoreType = useScoreType;
  }
  final double? score = jsonConvert.convert<double>(json['score']);
  if (score != null) {
    userBettingEntity.score = score;
  }
  final String? orderNo = jsonConvert.convert<String>(json['orderNo']);
  if (orderNo != null) {
    userBettingEntity.orderNo = orderNo;
  }
  final String? status = jsonConvert.convert<String>(json['status']);
  if (status != null) {
    userBettingEntity.status = status;
  }
  final double? winScore = jsonConvert.convert<double>(json['winScore']);
  if (winScore != null) {
    userBettingEntity.winScore = winScore;
  }
  final String? createTime = jsonConvert.convert<String>(json['createTime']);
  if (createTime != null) {
    userBettingEntity.createTime = createTime;
  }
  final String? updateTime = jsonConvert.convert<String>(json['updateTime']);
  if (updateTime != null) {
    userBettingEntity.updateTime = updateTime;
  }
  final String? createOrderTime = jsonConvert.convert<String>(json['createOrderTime']);
  if (createOrderTime != null) {
    userBettingEntity.createOrderTime = createOrderTime;
  }
  return userBettingEntity;
}

Map<String, dynamic> $UserBettingEntityToJson(UserBettingEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['name'] = entity.name;
  data['playWay'] = entity.playWay;
  data['bettingType'] = entity.bettingType;
  data['isGroup'] = entity.isGroup;
  data['ratioId'] = entity.ratioId;
  data['groupId'] = entity.groupId;
  data['useScoreType'] = entity.useScoreType;
  data['score'] = entity.score;
  data['orderNo'] = entity.orderNo;
  data['status'] = entity.status;
  data['winScore'] = entity.winScore;
  data['createTime'] = entity.createTime;
  data['updateTime'] = entity.updateTime;
  data['createOrderTime'] = entity.createOrderTime;
  return data;
}

UserBettingPageEntity $UserBettingPageEntityFromJson(Map<String, dynamic> json) {
  final UserBettingPageEntity pageEntity = UserBettingPageEntity();
  final int? total = jsonConvert.convert<int>(json['total']);
  if (total != null) {
    pageEntity.total = total;
  }
  final int? size = jsonConvert.convert<int>(json['size']);
  if (size != null) {
    pageEntity.size = size;
  }
  final int? current = jsonConvert.convert<int>(json['current']);
  if (current != null) {
    pageEntity.current = current;
  }
  final int? pages = jsonConvert.convert<int>(json['pages']);
  if (pages != null) {
    pageEntity.pages = pages;
  }
  final List<UserBettingEntity>? records = jsonConvert.convert<List<UserBettingEntity>>(json['records']);
  if (records != null) {
    pageEntity.records = records;
  }
  return pageEntity;
}

Map<String, dynamic> $UserBettingPageEntityToJson(UserBettingPageEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['total'] = entity.total;
  data['size'] = entity.size;
  data['current'] = entity.current;
  data['records'] = entity.records;
  data['pages'] = entity.pages;
  return data;
}